package dk.pun.aot.client.event;

import com.google.gwt.event.shared.GwtEvent;

import dk.pun.aot.shared.character.CharacterId;

public class CharacterSelectedEvent extends GwtEvent<CharacterSelectedEventHandler> {

	public static Type<CharacterSelectedEventHandler> TYPE = new Type<CharacterSelectedEventHandler>();

	private final CharacterId characterId;

	public CharacterSelectedEvent(CharacterId characterId) {
		this.characterId = characterId;
	}

	public CharacterId getCharacterId() {
		return this.characterId;
	}

	@Override
	public Type<CharacterSelectedEventHandler> getAssociatedType() {
		return TYPE;
	}

	@Override
	protected void dispatch(CharacterSelectedEventHandler handler) {
		handler.onCharacterSelected(this);
	}

}
